#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <stdint.h> 
 
#define I2C_DEV "/dev/i2c-0"//device iic0   //在这里使用的是iic2
 
extern int iicfd;
 
void iic_init(void); //IIC初始化
void iic_write(unsigned char addr,unsigned char dat);//IIC写入函数
unsigned char iic_read(unsigned char addr);//IIC读取函数

int i2c_write(int fd, uint8_t addr, uint8_t reg, uint8_t data);
int i2c_read(int fd, uint8_t addr, uint8_t reg, uint8_t *data, uint8_t len);
